package leetcode.code200;

import leetcode.IDebug;
import leetcode.helper.HelpDebug;

public abstract class Solution200 implements IDebug {

	public abstract int numIslands(char[][] grid);

	private void debug(String string, int expect) {
		char[][] grid = HelpDebug.str2array5(string);
		int result = this.numIslands(grid);
		HelpDebug.compare(expect, result);
	}

	@Override
	public void debug1() {
		String string = "[[\"1\",\"1\",\"1\",\"1\",\"0\"],[\"1\",\"1\",\"0\",\"1\",\"0\"],[\"1\",\"1\",\"0\",\"0\",\"0\"],[\"0\",\"0\",\"0\",\"0\",\"0\"]]";
		int expect = 1;
		this.debug(string, expect);
	}

	@Override
	public void debug2() {
		String string = "[[\"1\",\"1\",\"0\",\"0\",\"0\"],[\"1\",\"1\",\"0\",\"0\",\"0\"],[\"0\",\"0\",\"1\",\"0\",\"0\"],[\"0\",\"0\",\"0\",\"1\",\"1\"]]";
		int expect = 3;
		this.debug(string, expect);
	}

	@Override
	public void debug3() {
		// TODO Auto-generated method stub

	}

	@Override
	public void debug4() {
		// TODO Auto-generated method stub

	}

}
